﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SBACN.WebSite.Code;
using SBACN.WebSite.Models;
using System.Linq.Expressions;

namespace SBACN.WebSite.CouncilDList
{
	public partial class ComList : MemberBasePage
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			BindData(1);
		}

		protected void BindData(int pageIndex)
		{
			int records = 0;
			Expression<Func<TB_CouncilInfo, bool>>f = (p => !p.Status);
			Expression<Func<TB_CouncilInfo, int>> order = (c => c.Index);
			var resultC = DAL.DALHelper.Instance.GetList<TB_CouncilInfo, int>(f, order, false, this.Pager1.PageSize, pageIndex, out records);

			if (resultC.Count > 0)
			{
				this.CouncilList.DataSource = resultC;
				this.CouncilList.DataBind();
				this.Pager1.RecordCount = records;
				this.Pager1.InitControl();
			}
		}

		protected void BindSelectedPageIndexChanged(int pageIndex, int nextPage)
		{
			BindData(nextPage);
		}

	}
}